package com.cf.controller;

import com.cf.lock.core.ZLock;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * boot-distributed-lock-LocktestController
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/12 上午 10:10
 */
@RestController
public class LockTestController {

    @ZLock
    @RequestMapping("/get")
    public String lockTest() throws InterruptedException {
        System.out.println("进来了！");
        Thread.sleep(4000);
        return UUID.randomUUID().toString();
    }

}
